﻿#region ExcuteHalconProc_MultiThreadParameterProxy.cs
// ============================================================================
// This region will be filled automatically with data if you are working
// for example with Microsoft SourceSafe
//
// Purpose:          
// Specifics: 
// 
// Creation date:    2024/5/27 14:23:14
// Created by:       hao.chen
//
// $Author:        $
// $Date:          $
// $Revision:      $
// $History:       $
// $NoKeywords:    $
// 
// Copyright:      © 2024 YourCompanyName
//                 All Rights Reserved
// ============================================================================
#endregion

using NeuroCheck.PlugInLib.Base;
using NeuroCheck.PlugInLib.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;

// TODO: Namespace - Modify the namespace to the project namespace
namespace CLVisionHalconNC620
{
    /// <summary>Implements the parameter proxy class of the check function "ExcuteHalconProc_MultiThread", for configuration
    /// in the check function parameter dialog and the quick edit table.
    /// </summary>
    /// <remarks>It is recommended to provide parameters for modification only are not created at runtime.
    /// </remarks>
    [Obfuscation(ApplyToMembers = false)]
    public class ExcuteHalconProc_MultiThreadParameterProxy : NcPICheckFunctionParameterProxyBase
    {

        /// <summary>The check function parameter instance that is covered by this proxy.
        /// </summary>
        /// <remarks>An object like this is often called as "Source Object".
        /// </remarks>
        private ExcuteHalconProc_MultiThreadParameter m_SourceObject;

        /// <summary>Constructor.
        /// </summary>
        private ExcuteHalconProc_MultiThreadParameterProxy()
            : base()
        {
        }

        /// <summary>Constructor.
        /// </summary>
        /// <param name="sourceObject">The check function parameter instance that is covered by this proxy.</param>
        public ExcuteHalconProc_MultiThreadParameterProxy(ExcuteHalconProc_MultiThreadParameter sourceObject)
            : this()
        {
            Assign(sourceObject);
        }

        //对应输入输出四个表格
        private List<(string, string, string)> _ls_iconic_Input = new List<(string, string, string)>();
        private List<(string, string, string)> _ls_iconic_Output = new List<(string, string, string)>();
        private List<(string, string, string)> _ls_control_Input = new List<(string, string, string)>();
        private List<(string, string, string)> _ls_control_Output = new List<(string, string, string)>();
        //对应cfg表格
        private List<(string, string, List<string>, string)> _ls_cfg_Par = new List<(string, string, List<string>, string)>();

        //存储所有设置过的procedure的参数
        private Dictionary<string, (List<(string, string, string)>, List<(string, string, string)>, List<(string, string, string)>, List<(string, string, string)>, List<(string, string, List<string>, string)>)> _dic_proceduresPar
            = new Dictionary<string, (List<(string, string, string)>, List<(string, string, string)>, List<(string, string, string)>, List<(string, string, string)>, List<(string, string, List<string>, string)>)>();
        private string _currentProcedureName;


        public List<(string, string, string)> Ls_iconic_Input
        {
            get { return _ls_iconic_Input; }
            set
            {
                _ls_iconic_Input = value;
                base.IsModified = true;
                base.CallUpdateController("Ls_iconic_Input", _ls_iconic_Input);
            }
        }
        public List<(string, string, string)> Ls_iconic_Output
        {
            get { return _ls_iconic_Output; }
            set
            {
                _ls_iconic_Output = value;
                base.IsModified = true;
                base.CallUpdateController("Ls_iconic_Output", _ls_iconic_Output);
            }
        }
        public List<(string, string, string)> Ls_control_Input
        {
            get { return _ls_control_Input; }
            set
            {
                _ls_control_Input = value;
                base.IsModified = true;
                base.CallUpdateController("Ls_control_Input", _ls_control_Input);
            }
        }
        public List<(string, string, string)> Ls_control_Output
        {
            get { return _ls_control_Output; }
            set
            {
                _ls_control_Output = value;
                base.IsModified = true;
                base.CallUpdateController("Ls_control_Output", _ls_control_Output);
            }
        }
        public List<(string, string, List<string>, string)> Ls_cfg_Par
        {
            get { return _ls_cfg_Par; }
            set
            {
                _ls_cfg_Par = value;
                base.IsModified = true;
                base.CallUpdateController("Ls_cfg_Par", _ls_cfg_Par);
            }
        }
        //Ls_iconic_Input = Dic_proceduresPar[procedureName].Item1;
        //Ls_iconic_Output = Dic_proceduresPar[procedureName].Item2;
        //Ls_control_Input = Dic_proceduresPar[procedureName].Item3;
        //Ls_control_Output = Dic_proceduresPar[procedureName].Item4;
        //Ls_cfg_Par = m_ProxyInstance.Dic_proceduresPar[procedureName].Item5;

        //Hdvp名称，   Hdvp对应的图像输入，图像输出，控制输入，控制输出，cfg可设参数
        public Dictionary<string, (List<(string, string, string)>, List<(string, string, string)>, List<(string, string, string)>, List<(string, string, string)>, List<(string, string, List<string>, string)>)> Dic_proceduresPar
        {
            get { return _dic_proceduresPar; }
            set
            {
                _dic_proceduresPar = value;
                base.IsModified = true;
                base.CallUpdateController("Dic_proceduresPar", _dic_proceduresPar);
            }
        }
        public string CurrentProcedureName
        {
            get { return _currentProcedureName; }
            set
            {
                _currentProcedureName = value;
                base.IsModified = true;
                base.CallUpdateController("CurrentProcedureName", _currentProcedureName);
            }
        }
        /// <summary> Creates a clone of this object.
        /// </summary>
        /// <returns>Clone.</returns>
        public override object Clone()
        {
            ExcuteHalconProc_MultiThreadParameterProxy clone = new ExcuteHalconProc_MultiThreadParameterProxy();
            base.CloneBaseMembers(clone);
            clone.m_SourceObject = m_SourceObject;

            clone.Ls_iconic_Input = _ls_iconic_Input;
            clone.Ls_iconic_Output = _ls_iconic_Output;
            clone.Ls_control_Input = _ls_control_Input;
            clone.Ls_control_Output = _ls_control_Output;
            clone.Ls_cfg_Par = _ls_cfg_Par;
            clone.Dic_proceduresPar = _dic_proceduresPar;
            clone.CurrentProcedureName = _currentProcedureName;

            return clone;
        }

        /// <summary>Updates the values of the covered check function parameter instance by the values of this proxy instance.
        /// </summary>
        public override void UpdateSourceObject()
        {
            m_SourceObject.Ls_iconic_Input = _ls_iconic_Input;
            m_SourceObject.Ls_iconic_Output = _ls_iconic_Output;
            m_SourceObject.Ls_control_Input = _ls_control_Input;
            m_SourceObject.Ls_control_Output = _ls_control_Output;
            m_SourceObject.Ls_cfg_Par = _ls_cfg_Par;
            m_SourceObject.Dic_proceduresPar = _dic_proceduresPar;
            m_SourceObject.CurrentProcedureName = _currentProcedureName;
        }

   

        /// <summary>Assigns the values of the covered check function parameter instance to the values of this proxy instance.
        /// </summary>
        /// <param name="sourceObject">The check function parameter instance that is covered by this proxy.</param>
        private void Assign(ExcuteHalconProc_MultiThreadParameter sourceObject)
        {
            m_SourceObject = sourceObject;

            _ls_iconic_Input = sourceObject.Ls_iconic_Input;
            _ls_iconic_Output = sourceObject.Ls_iconic_Output;
            _ls_control_Input = sourceObject.Ls_control_Input;
            _ls_control_Output = sourceObject.Ls_control_Output;
            _ls_cfg_Par = sourceObject.Ls_cfg_Par;
            _dic_proceduresPar = sourceObject.Dic_proceduresPar;
            _currentProcedureName = sourceObject.CurrentProcedureName;
        }

     
    } // end of class
} // end of namespace